﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Runtime.Design;

namespace ToddMcDermid.SSIS
{
    class SendHTMLMailTaskInterface : IDtsTaskUI
    {
        #region Private Variables
        private TaskHost _taskHost;
        private Connections _connections;
        #endregion

        #region Constructor
        public SendHTMLMailTaskInterface()
        { }
        #endregion

        #region IDtsTaskUI Interface
        public void Initialize(TaskHost taskHost, IServiceProvider serviceProvider)
        {
            // Store references to the task and connection metadata.
            this._taskHost = taskHost;
            IDtsConnectionService cs = serviceProvider.GetService(typeof(IDtsConnectionService)) as IDtsConnectionService;
            this._connections = cs.GetConnections();
        }

        public ContainerControl GetView()
        {
            // Launch your editor with information from your task and available connections
            return new SendHTMLMailTaskEditor(this._taskHost, this._connections);
        }

        public void Delete(IWin32Window parentWindow)
        {
        }

        public void New(IWin32Window parentWindow)
        {
        }
        #endregion
    }
}
